$ ->
    $('.destroy').click ->
        if confirm '你确定要删除吗,删除不可恢复!'
            _id=$('.destroy').data("id")
            $.ajax
                url: "/delete/#{_id}"
                type: 'POST'
                data:
                    '_method':'delete'
                error: (jqXHR, textStatus, errorThrown) ->
                    $('body').append "AJAX Error: #{textStatus}"
                success: (data, textStatus, jqXHR) ->
                    $('body').append "Successful AJAX call: #{data}"
